package com.ews.onlineexchange.controller;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.enterprise.inject.Produces;
import javax.faces.bean.ApplicationScoped;
import javax.inject.Named;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
@Path("/system")
@Named
@ApplicationScoped
public class DatetimeController {
	
	@Produces
	@Named("currentDatetime")
	public long getCurrentDatetime() {
		return new Date().getTime();
	}
	
	DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS");
	@GET
	@Path( "/getSystemTime")
	@javax.ws.rs.Produces( MediaType.TEXT_PLAIN )
	@Context
	public long getSystemTime() {
		return new Date().getTime();
		
	}
}
